package com.dream.technology.service;

import com.dream.technology.db.entity.RcRule;
import com.dream.technology.db.entity.RcRuleQuery;
import com.dream.technology.db.entity.vo.VoRule;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface RcRuleService {

    int countByExample(RcRuleQuery example);

    int deleteByExample(RcRuleQuery example);

    int deleteByPrimaryKey(Long id);

    int insert(RcRule record);
    String insertStr(VoRule record);

    int insertSelective(RcRule record);

    List<RcRule> selectByExample(RcRuleQuery example);

    RcRule selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") RcRule record, @Param("example") RcRuleQuery example);

    int updateByExample(@Param("record") RcRule record, @Param("example") RcRuleQuery example);

    int updateByPrimaryKeySelective(RcRule record);

    int updateByPrimaryKey(RcRule record);

    /**
     * 查询指定id的规则集合
     * 配置规则集验证
     * @param ids
     * @return
     */
    List<RcRule> selectByIdInList(List<Long> ids);

    String checkRule(VoRule rule);
    Map<String, Object> checkRuleRef(Long ruleId) ;


    /**
     *  复制流程
     * @param id
     * @param tagName
     * @param tagCode
     * @param enabled 
     * @return
     */
    String copy(Long id, String tagName, String tagCode, Boolean enabled);


    /**
     *  解析自定义json 修改规则
     * @param jsonStr
     * @return
     */
    String updateByJsonStr(VoRule jsonStr);
}
